<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>添加商品</title>
	<script type="text/javascript">
		function method01(){
			var textErrorElement=document.getElementById('goods_nameerror');
			textErrorElement.innerHTML='<font>***商品名必须是1-10位</font>';
			//获取文本框里输入的内容
			var textElement=document.getElementById('goods_name');
			var textContent=textElement.value;
			//判断是否符合条件
			if(!(textElement!=null&&textElement.length>=1;textElement.length<=10)){
				textErrorElement.innerHTML='&nbsp;&nbsp;<font color="red">商品名出错！</font>';
				return false;
			}
			return true;
		}
	</script>
</head>
<body>
<form action="/project06/servlet/addgoodsforservlet02" method="post" enctype="multipart/form-data" onsubmit="return method01()">
  商品名称：<input type="text" id="goods_name"><span id="goods_nameerror"><font>***商品名必须是1-10位</font></span><br>
  商品 描述：<input type="text" id="goods_desc"><br>
  商品图片：<input type="file" id="goods_image"><br> 
  商品 价格：<input type="text" id="goods_price"><br>
  商品 库存：<input type="text" id="goods_stock"><br>
<input type="submit" value="添加">
<input type="reset" value="重置">
</form>




</body>
</html>